/*
    pta B1053
*/
#include<bits/stdc++.h>
using namespace std;
int main(){
	int n,d;
    int s;
    double e;
	cin>>n>>e>>d;
    s=n;
	int sum1=0,sum2=0;
	while(s--){
		int k;cin>>k;
		int flag=1;
		int temp=0,temp2=0;
		for(int i=0;i<k;i++){
			double m;cin>>m; 
			if(m<e) temp++;
            
		}
		if(k>d&&temp>k/2) sum2++,flag=0;
		if(temp>k/2&&flag) sum1++;
	} 
	double a=sum1*100.0/n;
	double b=sum2*100.0/n;
	printf("%.1lf%% %.1lf%%",a,b);//!!!!输出百分之的数：必须要加两个百分号
}
 